package com.dulichdanang.weather;

import com.dulichdanang.R;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TextView;

public class SingleMenuItemActivity  extends Activity {
	
	// XML node keys
	static final String KEY_DAY = "day";
	static final String KEY_HIGH = "high";
	static final String KEY_LOW = "low";
	static final String KEY_DATE = "date";
	static final String KEY_SKYCO = "skycodeday";
	static final String KEY_SKYTE = "skytextday";
	static final String KEY_SHO = "shortday";
	static final String KEY_PRE = "precip";
	//private static final String KEY_HIGH = null;
	@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.weather_single_list_item);
        
        // getting intent data
        Intent in = getIntent();
        
        // Get XML values from previous intent
        String day = in.getStringExtra(KEY_DAY);
        String high = in.getStringExtra(KEY_HIGH);
        String low = in.getStringExtra(KEY_LOW);
        String date = in.getStringExtra(KEY_DATE);
        String skyco = in.getStringExtra(KEY_SKYCO);
        String skyte = in.getStringExtra(KEY_SKYTE);
        String sho = in.getStringExtra(KEY_SHO);
        String pre = in.getStringExtra(KEY_PRE);
       
        String chitiet=skyte+" Low: "+low;
        String nhietdo=sho+" - "+skyte+". High: "+high+" Low:"+low;
        // Displaying all values on the screen
        TextView lblDay = (TextView) findViewById(R.id.day_label);
        TextView lblDate = (TextView) findViewById(R.id.date_label);
        TextView lblHigh = (TextView) findViewById(R.id.high_label);
       TextView lblLow = (TextView) findViewById(R.id.low_label);
        
        TextView lblSkyco = (TextView) findViewById(R.id.skyco_label);
       TextView lblSkyte = (TextView) findViewById(R.id.skyte_label);
        TextView lblSho = (TextView) findViewById(R.id.sho_label);
        TextView lblPre = (TextView) findViewById(R.id.pre_label);
        
        lblDay.setText(day);
        lblDate.setText(date);
       lblHigh.setText(chitiet);
       lblLow.setText(nhietdo);       
        lblSkyco.setText("");
        lblSkyte.setText("");
        lblSho.setText("");
        lblPre.setText("");
    }
}
